﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Orchard.ContentManagement.Drivers;
using Orchard;
using Orchard.Environment.Extensions;
using Contrib.Mod.AccountWidgets.Models;

namespace Contrib.Mod.AccountWidgets.Drivers
{
    [OrchardFeature("Contrib.Mod.AccountWidgets.LoginWidgets")]
    public class LoginWidgetPartDriver : ContentPartDriver<LoginWidgetPart>
    {
        private readonly IOrchardServices _orchardServices;

        public LoginWidgetPartDriver(IOrchardServices orchardServices)
        {
            _orchardServices = orchardServices;
        }

        protected override DriverResult Display(LoginWidgetPart part, string displayType, dynamic shapeHelper)
        {
            var shape = _orchardServices.New.LogOn().Title("Log On");

            return
                ContentShape("LogOn", () => shapeHelper.LogOn());

            

        }
    }
}